import sys
import pokeparser

item = open('text/item.txt', 'r', encoding='utf-8')
lst = open('text/listitem.txt', 'a+', encoding='utf-8')

p = pokeparser.pokeparser()

il = []

for line in item:
	il.append(line)

lens = len(il)

count = 0
while count < lens:
	i = p.convert(il[count])
	if (i[4]=='道具' and i[5]=='其他') or (i[4]=='Ｚ纯晶' and i[5]=='宝可梦使用的Ｚ纯晶') or i[4]=='树果':
		temp = sys.stdout
		sys.stdout = lst
		print(i)
		lst.flush()
		sys.stdout = temp
		print(i)
	count += 1